<% transaction ||= @transaction %>
<% if transaction %><h3><%= transaction.has_errors? ? 'Failed' : 'Successful' %> <%= transaction.transaction_type.titleize %></h3><% end %>

<%= @errors || render(Samurai::Rails::Views.errors) %>

<% if transaction %>
  <p>
    <strong>Amount:</strong>
    <%= transaction.amount %> (<%= transaction.currency_code %>)
  </p>

  <p>
    <strong>Credit Card:</strong>
    <em>XXXX XXXX XXXX</em> <%= transaction.payment_method.last_four_digits %>
    (<%= "%02d" % transaction.payment_method.expiry_month %> / <%= "%04d" % transaction.payment_method.expiry_year %>)
  </p>

  <p><strong>Date / Time:</strong> <%= transaction.created_at %></p>
  <p>
    <strong>Description:</strong> <%= transaction.description %><br>
    <strong>Billing Reference:</strong> <%= transaction.billing_reference %><br>
    <strong>Customer Reference: </strong> <%= transaction.customer_reference %><br>
    <strong>Custom Data: </strong> <%= transaction.custom %><br>
  </p>

  <p>
    <strong>AVS Response:</strong> <%= transaction.processor_response.try(:avs_result_code) || 'None' %>
  </p>
<% end %>
